home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / AIncludes / ConditionalMacros.a < prev    next >
Encoding:
Text File  |  1998-04-09  |  9.3 KB  |  251 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        ConditionalMacros.a
  3. ;
  4. ;    Contains:    Set up for compiler independent conditionals
  5. ;
  6. ;    Version:    Technology:    Universal Interface Files 3.1
  7. ;                Release:    QuickTime 3.0
  8. ;
  9. ;    Copyright:    © 1993-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  19. __CONDITIONALMACROS__ SET 1
  20.  
  21. ; ****************************************************************************************************
  22. ;    UNIVERSAL_INTERFACES_VERSION
  23. ;    
  24. ;        0x0310 => version 3.1
  25. ;        0x0301 => version 3.0.1
  26. ;        0x0300 => version 3.0
  27. ;        0x0210 => version 2.1
  28. ;        This conditional did not exist prior to version 2.1
  29. ;***************************************************************************************************
  30.  
  31. UNIVERSAL_INTERFACES_VERSION EQU $0310
  32.  
  33. ; ****************************************************************************************************
  34. ;
  35. ;    TARGET_CPU_≈    
  36. ;    These conditionals specify which microprocessor instruction set is being
  37. ;    generated.  At most one of these is true, the rest are false.
  38. ;
  39. ;        TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  40. ;        TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  41. ;        TARGET_CPU_X86            - Compiler is generating x86 instructions
  42. ;        TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  43. ;        TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  44. ;        TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  45. ;
  46. ;
  47. ;    TARGET_OS_≈    
  48. ;    These conditionals specify in which Operating System the generated code will
  49. ;    run. At most one of the these is true, the rest are false.
  50. ;
  51. ;        TARGET_OS_MAC            - Generate code will run under Mac OS
  52. ;        TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  53. ;        TARGET_OS_UNIX            - Generate code will run under some unix 
  54. ;
  55. ;
  56. ;    TARGET_RT_≈    
  57. ;    These conditionals specify in which runtime the generated code will
  58. ;    run. This is needed when the OS and CPU support more than one runtime
  59. ;    (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  60. ;
  61. ;        TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  62. ;        TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  63. ;        TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  64. ;        TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  65. ;
  66. ;
  67. ;    PRAGMA_≈
  68. ;    These conditionals specify whether the compiler supports particular #pragma's
  69. ;    
  70. ;        PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  71. ;        PRAGMA_ONCE              - Compiler supports: #pragma once
  72. ;        PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  73. ;        PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  74. ;        PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  75. ;        PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  76. ;        PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  77. ;        PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  78. ;
  79. ;    FOUR_CHAR_CODE
  80. ;    This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  81. ;    is compiled down to the correct value on all compilers.
  82. ;
  83. ;        FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  84. ;
  85. ;    TYPE_≈
  86. ;    These conditionals specify whether the compiler supports particular types.
  87. ;
  88. ;        TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  89. ;        TYPE_BOOL                - Compiler supports "bool"
  90. ;        TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  91. ;
  92. ;***************************************************************************************************
  93.  
  94.  
  95.  
  96.     IF &TYPE('PowerAsm') <> 'UNDEFINED' THEN
  97.         ;
  98.         ;    PPCAsm PowerPC assembler from Apple Computer, Inc.    
  99.         ;
  100.         TARGET_CPU_68K:                SET     0
  101.         TARGET_CPU_PPC:                SET      1
  102.         TARGET_CPU_X86:                SET      0
  103.         TARGET_CPU_MIPS:            SET     0
  104.         TARGET_CPU_SPARC:            SET     0
  105.         TARGET_RT_MAC_CFM:            SET        1
  106.         TARGET_RT_MAC_68881:        SET        0
  107.         TARGET_OS_MAC:                SET        1
  108.         TARGET_OS_WIN32:            SET        0
  109.         TARGET_OS_UNIX:                SET        0
  110.         TARGET_RT_LITTLE_ENDIAN:    SET        0
  111.         TARGET_RT_BIG_ENDIAN:        SET        1
  112.         TYPE_EXTENDED:                SET        0
  113.         TYPE_LONGLONG:                SET        0
  114.         TYPE_BOOL:                    SET        0
  115.     ELSE
  116.         ;
  117.         ;    Asm 68K assembler from Apple Computer, Inc.    
  118.         ;
  119.         TARGET_CPU_68K:                SET     1
  120.         TARGET_CPU_PPC:                SET      0
  121.         TARGET_CPU_X86:                SET      0
  122.         TARGET_CPU_MIPS:            SET     0
  123.         TARGET_CPU_SPARC:            SET     0
  124.         IF (&TYPE('&SYSMODEL') <> 'UNDEFINED') AND (&SYSMODEL = '__CFM68K__') THEN
  125.             TARGET_RT_MAC_CFM:        SET     1    
  126.         ELSE
  127.             TARGET_RT_MAC_CFM:        SET     0    
  128.         ENDIF
  129.         IF &TYPE('FP0') = 'FPREG FP0' THEN
  130.             TARGET_RT_MAC_68881:    SET     1    
  131.         ELSE
  132.             TARGET_RT_MAC_68881:    SET     0    
  133.         ENDIF
  134.         TARGET_OS_MAC:                SET        1
  135.         TARGET_OS_WIN32:            SET        0
  136.         TARGET_OS_UNIX:                SET        0
  137.         TARGET_RT_LITTLE_ENDIAN:    SET        0
  138.         TARGET_RT_BIG_ENDIAN:        SET        1
  139.         TYPE_EXTENDED:                SET        1
  140.         TYPE_LONGLONG:                SET        0
  141.         TYPE_BOOL:                    SET        0
  142.     ENDIF
  143.  
  144.  
  145.  
  146.  
  147. ; ****************************************************************************************************
  148. ;    Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  149. ;
  150. ;    GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  151. ;    GENERATING68K            - Compiler is generating 68k family instructions
  152. ;    GENERATING68881            - Compiler is generating mc68881 floating point instructions
  153. ;    GENERATINGCFM            - Code being generated assumes CFM calling conventions
  154. ;    CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  155. ;    PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  156. ;    PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  157. ;
  158. ;***************************************************************************************************
  159.  
  160.     IF TARGET_OS_MAC THEN
  161.     GENERATINGPOWERPC: SET TARGET_CPU_PPC
  162.     GENERATING68K: SET TARGET_CPU_68K
  163.     GENERATING68881: SET TARGET_RT_MAC_68881
  164.     GENERATINGCFM: SET TARGET_RT_MAC_CFM
  165.     CFMSYSTEMCALLS: SET TARGET_RT_MAC_CFM
  166. ;    NOTE: The FOR_≈ conditionals were developed to produce integerated
  167. ;          interface files for System 7 and Copland.  Now that Copland
  168. ;          is canceled, all FOR_ conditionals have been removed from
  169. ;          the interface files.  But, just in case you someone got an 
  170. ;          interface file that uses them, the following sets the FOR_≈
  171. ;          conditionals to a consistent, usable state.
  172. ;
  173. ;    #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES        0
  174. ;    #ifndef FOR_PTR_BASED_AE
  175. ;        #define FOR_PTR_BASED_AE                    0
  176. ;    #endif
  177. ;    #define FOR_SYSTEM7_ONLY                        1
  178. ;    #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED        1
  179. ;    #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE        1
  180. ;    #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE        1
  181. ;    #define FOR_SYSTEM8_COOPERATIVE                    0
  182. ;    #define FOR_SYSTEM8_PREEMPTIVE                    0
  183. ;
  184.  
  185.     ENDIF    ; TARGET_OS_MAC
  186.  
  187.  
  188.  
  189. ; ****************************************************************************************************
  190. ;
  191. ;    OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  192. ;                              (e.g. DisposPtr instead of DisposePtr). The names of system routine
  193. ;                              are now more sensitive to change because CFM binds by name.  In the 
  194. ;                              past, system routine names were compiled out to just an A-Trap.  
  195. ;                              Macros have been added that each map an old name to its new name.  
  196. ;                              This allows old routine names to be used in existing source files,
  197. ;                              but the macros only work if OLDROUTINENAMES is true.  This support
  198. ;                              will be removed in the near future.  Thus, all source code should 
  199. ;                              be changed to use the new names! You can set OLDROUTINENAMES to false
  200. ;                              to see if your code has any old names left in it.
  201. ;    
  202. ;    OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  203. ;                              has been moved from Strings to TextUtils.  It is conditionalized in
  204. ;                              Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  205. ;                              This allows developers to upgrade to newer interface files without 
  206. ;                              having to change the includes in their source code.  But, it allows
  207. ;                              the slow migration of system calls to more understandable file locations.  
  208. ;                              OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  209. ;                              default to false.
  210. ;
  211. ;***************************************************************************************************
  212.  
  213.     IF &TYPE('OLDROUTINENAMES') = 'UNDEFINED' THEN
  214.     OLDROUTINENAMES: SET 0
  215.     ENDIF
  216.     IF &TYPE('OLDROUTINELOCATIONS') = 'UNDEFINED' THEN
  217.     OLDROUTINELOCATIONS: SET 0
  218.     ENDIF
  219.  
  220. ;****************************************************************************************************
  221. ;    IMPORT_CFM_FUNCTION     -    Macro used instead of IMPORT pseduo opcode because PowerPC
  222. ;                                and 68K CFM runtimes differ on naming of imported functions.
  223. ;                                PowerPC requires a period (.) in front of the name and CFM 68K
  224. ;                                does not.  This macros supplies the period for PowerPC.
  225. ;***************************************************************************************************
  226.  
  227.     IF TARGET_RT_MAC_CFM THEN
  228.         IF TARGET_CPU_PPC THEN
  229.             Macro
  230.             IMPORT_CFM_FUNCTION        &functionName
  231.             IMPORT                    .&functionName
  232.             EndM
  233.         ELSE
  234.             Macro
  235.             IMPORT_CFM_FUNCTION        &functionName
  236.             IMPORT                    &functionName
  237.             EndM
  238.         ENDIF    ; TARGET_OS_PPC
  239.     ENDIF    ; TARGET_RT_MAC_CFM
  240.  
  241.  
  242.  
  243. CGLUESUPPORTED        EQU        0
  244.  
  245.  
  246.  
  247.  
  248.     ENDIF ; __CONDITIONALMACROS__ 
  249.  
  250.